import getApiData from "@/services/cpasRequest";
import notify from 'devextreme/ui/notify';

//  获取待重分类科目批量设置对方科目列表
export async function getKMMapDataList(params: {
  dbname: string,
  billID: string,
  Data_ID: string
}) {
  const res = await getApiData("account.adjustingEntry.CFL.KMMap.getDataList", params);
  if (res.ok) return res.data;
}


//  获取重复类科目匹配配置列表
export async function getCFLKMConfigDataList(params: {
  dbname: string,
  Data_ID: string
}) {
  const res = await getApiData("account.adjustingEntry.CFLKMConfig.getDataList", params);
  if (res.ok) return res.data;
}

//  获取重复类科目匹配配置列表
export async function CFLKMConfigUpdate(params: {
  dbname: string,
  Data_ID: string,
  GUID: string,
  JFKMBH: string,
  DFKMBH: string
}) {
  const res = await getApiData("account.adjustingEntry.CFLKMConfig.update", params);
  if (res.ok) return res.data;
}

//  删除 重分类
export async function CFLKMConfigDelete(params: {
  dbname: string,
  GUID: string,
}) {
  const res = await getApiData("account.adjustingEntry.CFLKMConfig.delete", params);
  if (res.ok) return res.ok;
}

//  设置待重分类科目的对方科目信息
export async function updateMap(params: {
  dbname: string,
  billID: string,
  YSKMBH: string,
  GUID: string,
  YSHSXMBH: string,
  HSXMLXMC: string,
  HSXMLXBH: string,
  KMMC: string,
  KMBH: string,
  HSXMMC: string,
  HSXMBH: string ,
  YSHSXMMC: string,
  itemNames3: string,
  YSKMMC: string,
  PKMBH: string
}) {
  const res = await getApiData("account.adjustingEntry.CFL.KMMap.updateMap", params);
  if (res.ok) return res.ok;
}


//  完成设置待重分类科目的对方科目信息，自动解析批量设置的对方科目到待重分类的记录。
export async function AdjustingEntryKMMapSave(params: {
  dbname: string,
  billID: string,
  Data_ID: string,
  editUser: string | number 
}) {
  const res = await getApiData("account.adjustingEntry.CFL.KMMap.save", params);
  if (res.ok) return res.ok;
}








